// /zhaokao-info/page

import { post, get } from '@/common/http/request';
import request from '@/common/http/axios';

export const geCourseInfoList = params => {
  // return post('/zhaokao-info/page', params);
  return request({
    url: '/course-info/admin/list',
    method: 'post',
    data: params,
  });
};
// course-info/create
export const createCourseInfo = params => {
  return request({
    url: '/course-info/create',
    method: 'post',
    data: params,
  });
};
// /post/admin/delete GET

export const deleteCourseInfo = id => {
  // return post(`/zhaokao-info/delete/${id}`);
  return request({
    url: `/course-info/admin/delete?id=${id}`,
    method: 'get',
  });
};

// /course-info/admin/playAuth
export const getPlayAuth = id => {
  return request({
    url: `/course-info/admin/playAuth?videoId=${id}`,
    method: 'get',
  });
};

// vod/createAndUploadVideo
export const createAndUploadVideo = params => {
  return request({
    url: '/vod/createAndUploadVideo',
    method: 'post',
    data: params,
    headers: {
      'Content-Type': 'multipart/form-data',
    },
  });
};
// 更新课程信息
export const updateCourseInfo = params => {
  return request({
    url: '/course-info/update',
    method: 'post',
    data: params,
  });
};

// /post/get/{id}  get
export const getPostDetail = id => {
  return request({
    url: `/post/get/${id}`,
    method: 'get',
  });
};

// /post/create  post
export const createPost = params => {
  return request({
    url: `/post/create`,
    method: 'post',
    data: params,
  });
};

// /postComment/admin/list POST
export const getCommentList = params => {
  return request({
    url: `/postComment/admin/list`,
    method: 'post',
    data: params,
  });
};
// /postComment/delete GET
export const deleteComment = id => {
  return request({
    url: `/postComment/delete?id=${id}`,
    method: 'get',
  });
};
